package com.example.yang.synchronizeddemo;

import android.app.Activity;
import android.content.Context;
import android.util.Log;

/**
 * Created by yang_ on 2018/3/29.
 */

public class ActivityHelper {
    private Context mContext;
    public ActivityHelper(Context context) {
        this.mContext=context;
    }
    /**     * 打印ActivityName     */
    public void printActivityName() {
        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    while (true)
                        try {
                            Thread.sleep(1000*30);
                            Log.d(ActivityHelper.class.getSimpleName(), ((Activity) mContext).getClass().getSimpleName());
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                }
            }).start();
        }
    }}
